<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">

<head>
<title>会员管理</title>
<meta name="keywords" content="社团管理系统，常州大学，课程设计" />

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="本系统基于TP3.2开发，感谢开源">
<link rel="shortcut icon" href="favicon.ico">
<link href="/shetuan-master/Public/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
<link href="/shetuan-master/Public/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
<link href="/shetuan-master/Public/css/animate.min.css" rel="stylesheet">
<link href="/shetuan-master/Public/css/style.min862f.css?v=4.1.0" rel="stylesheet">
<link href="/shetuan-master/Public/css/plugins/iCheck/custom.css" rel="stylesheet">

    <!--[if lt IE 9]>
<meta http-equiv="refresh" content="0;ie.html" />
<![endif]-->
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
                <div class="ibox-content">

                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>会员姓名</th>
                            <th>联系方式</th>
                            <th>入会时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(is_array($res)): foreach($res as $k=>$v): ?><tr class="gradeX">
                                <td><?php echo ($v["username"]); ?></td>
                                <td><?php echo ($v["usertelphone"]); ?></td>
                                <td><?php echo ($v["jointime"]); ?></td>
                                <td data-id="<?php echo ($v["id"]); ?>">
                                    <a target="_self" href="<?php echo U('Member/memberdetails',array('uid'=>$v['uid']));?>">
                                    <button type="button" class="btn btn-sm btn-info" id="subbtn">详情</button></a>
                                    |
                                    <button type="button" class="btn btn-sm btn-danger memberdel">删除</button>
                                </td>
                            </tr><?php endforeach; endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    </div>
</body>

<script src="/shetuan-master/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/shetuan-master/Public/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/shetuan-master/Public/js/plugins/jeditable/jquery.jeditable.js"></script>
<script src="/shetuan-master/Public/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="/shetuan-master/Public/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="/shetuan-master/Public/js/content.min.js?v=1.0.0"></script>
<script>
    $(document).ready(function(){$(".dataTables-example").dataTable();var oTable=$("#editable").dataTable();oTable.$("td").editable("http://www.zi-han.net/theme/example_ajax.php",{"callback":function(sValue,y){var aPos=oTable.fnGetPosition(this);oTable.fnUpdate(sValue,aPos[0],aPos[1])},"submitdata":function(value,settings){return{"row_id":this.parentNode.getAttribute("id"),"column":oTable.fnGetPosition(this)[2]}},"width":"90%","height":"100%"})});function fnClickAddRow(){$("#editable").dataTable().fnAddData(["Custom row","New row","New row","New row","New row"])};
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>

<script>
    $('.memberdel').on('click',function () {
        var btn = $(this);
        var memberid = btn.parent().data('id');
        var param = {memberid: memberid};
        var url = "<?php echo U('Member/memberdel');?>";
        $.ajax({
            url: url,
            data: param,
            dataType: 'json',
            type: 'post',
            success: function (data) {
                var dotr = btn.closest('tr');
                alert(data.info);
                if (data.status == 1) {
                    dotr.remove();
                }
            },
            error: function () {
                alert('操作失败');
            }
        })
    })
</script>
</html>